package mobidever.mygodutch.database.sqlitedal;

import mobidever.mygodutch.database.base.SQLiteHelper.SQLiteDataTable;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

public class SQLiteDALCreateView implements SQLiteDataTable
{

	private Context mContext;

	public SQLiteDALCreateView(Context pContext)
	{
		mContext = pContext;
	}

	public void onCreate(SQLiteDatabase pDatabase)
	{
		StringBuilder sCreateTableScript = new StringBuilder();

		sCreateTableScript.append("		Create View v_Payout As ");
		sCreateTableScript.append("		select a.*,b.ParentID,b.categoryname,b.Path,b.TypeFlag,c.AccountBookName from payout a LEFT JOIN category b ON a.categoryID = b.categoryID  LEFT JOIN accountbook c ON a.AccountBookID = c.AccountBookID");

		pDatabase.execSQL(sCreateTableScript.toString());

	}

	public void onUpdate(SQLiteDatabase pDatabase)
	{
		// TODO Auto-generated method stub

	}
}
